<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>领取记录</title>
    <link rel="stylesheet" href="plugins/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="css/global.css" media="all">
    <link rel="stylesheet" href="plugins/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="css/table.css" />
    <link rel="stylesheet" href="css/style.css" />
</head>

<body>
<div class="admin-main">
    <div class="handle-box">
            <form action="" class="layui-form">
                <div class="handle-item layui-clear">
                    <div class="fl" style="float: left;">
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label" style="width: auto;">模板名称：</label>
                                <div class="layui-input-inline" style="width: 200px;">
                                    <input type="text" class="layui-input" placeholder="请输入领取人"  >
                                </div>
                            </div>
                            <button class="layui-btn" >查询</button>
                        </div>
                    </div>
                     <span class="fr" style="float: right;">
                        <a class="layui-btn layui-btn-danger radius btn-delect" id="btn-delect-all"><i class="layui-icon">&#xe640;</i> 批量删除</a>
                        <a  class="layui-btn  btn-default" id="btn-addtemplate"><i class="layui-icon">&#xe608;</i> 上传模板</a>
                    </span>
                </div>
            </form>
    </div>
    <table class="site-table table-hover">
        <thead>
        <tr>
            <th style="width: 30px;"><input type="checkbox" id="selected-all"></th>
            <th>模板名称</th>
            <th>备注</th>
            <th>上传人</th>
            <th>更新时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <tr>
            <td  style="width: 30px;"><input type="checkbox"></td>
            <td>备案登记表</td>
            <td>分类备注</td>
            <td>韩晓云</td>
            <td>2016-12-12</td>
            <td>
                <a href="" class="layui-btn layui-btn-mini">下载</a>
                <a href="javascript:;" data-id="1" data-opt="del" class="layui-btn layui-btn-danger layui-btn-mini">删除</a>
            </td>
        </tr>
        <tr>
            <td  style="width: 30px;"><input type="checkbox"></td>
            <td>备案登记表</td>
            <td>分类备注</td>
            <td>韩晓云</td>
            <td>2016-12-12</td>
            <td>
                <a href="" class="layui-btn layui-btn-mini">下载</a>
                <a href="javascript:;" data-id="1" data-opt="del" class="layui-btn layui-btn-danger layui-btn-mini">删除</a>
            </td>
        </tr>

        </tbody>
    </table>

    <div class="admin-table-page">
        <div id="page" class="page">
        </div>
    </div>

</div>
<!-- <script type="text/javascript" src="js/layer.js"></script>-->
<script type="text/javascript" src="plugins/layui/layui.js"></script>
<script>
    layui.config({
        base: 'plugins/layui/modules/'
    });
    layui.use(['icheck', 'laypage','layer','form','laydate'], function() {
        var $ = layui.jquery,
                laypage = layui.laypage,
                layer = layui.layer;
        $('input').iCheck({
            checkboxClass: 'icheckbox_flat-green'
        });

        //分页操作
        laypage({
            cont: 'page',
            pages: 25, //总页数
            groups: 5, //连续显示分页数
            jump: function(obj, first) {
                //得到了当前页，用于向服务端请求对应数据
                var curr = obj.curr;
                if(!first) {
                    //layer.msg('第 '+ obj.curr +' 页');
                }
            }
        });
        //文件上传
        $("#btn-addtemplate").on('click',function(){
            layer.open({
                type: 2,
                title: '上传模板',
                fix: false,
                maxmin: true,
                shadeClose: true,
                area: ['500px', '200px'],
                content: 'templatenew.html',
                end: function(){
                    //layer.tips('Hi', '#about', {tips: 1})
                }
            });
        });
        //日期
        var laydate = layui.laydate;

        var start = {
            min: laydate.now()
            ,max: '2099-06-16 23:59:59'
            ,istoday: false
            ,choose: function(datas){
                end.min = datas; //开始日选好后，重置结束日的最小日期
                end.start = datas //将结束日的初始值设定为开始日
            }
        };

        var end = {
            min: laydate.now()
            ,max: '2099-06-16 23:59:59'
            ,istoday: false
            ,choose: function(datas){
                start.max = datas; //结束日选好后，重置开始日的最大日期
            }
        };

        //列表选择
        $('.site-table tbody tr').on('click', function(event) {
            var $this = $(this);
            var $input = $this.children('td').eq(0).find('input');
            $input.on('ifChecked', function(e) {
                $this.css('background-color', '#EEEEEE');
            });
            $input.on('ifUnchecked', function(e) {
                $this.removeAttr('style');
            });
            $input.iCheck('toggle');
        }).find('input').each(function() {
            var $this = $(this);
            $this.on('ifChecked', function(e) {
                $this.parents('tr').css('background-color', '#EEEEEE');
            });
            $this.on('ifUnchecked', function(e) {
                $this.parents('tr').removeAttr('style');
            });
        });
        //全选
        $('#selected-all').on('ifChanged', function(event) {
            var $input = $('.site-table tbody tr td').find('input');
            $input.iCheck(event.currentTarget.checked ? 'check' : 'uncheck');
        });

        //搜索区域
        var form = layui.form(),
                layer = layui.layer,
                layedit = layui.layedit,
                laydate = layui.laydate;
        //自定义验证规则
        form.verify({
            /* police: function(value) {
             if(value.length < 4) {
             return '标题至少得4个字符啊';
             }
             },
             pass: [/(.+){6,12}$/, '密码必须6到12位'],
             content: function(value) {
             layedit.sync(editIndex);
             }*/
        });

        //监听提交
        form.on('submit(branch)', function(data) {
            layer.alert(JSON.stringify(data.field), {
                title: '最终的提交信息'
            })
            return false;
        });
    });
</script>

</body>

</html>